package cn.highset.modules.base.service;

import cn.highset.base.HighsetBaseService;
import cn.highset.common.vo.SearchVo;
import cn.highset.modules.base.entity.Banner;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;

/**
 * 轮播图表接口
 *
 * @author Victor
 */
@CacheConfig(cacheNames = "banner")
public interface BannerService extends HighsetBaseService<Banner, String> {

    /**
     * 多条件分页获取
     *
     * @param banner
     * @param searchVo
     * @param pageable
     * @return
     */
    Page<Banner> findByCondition(Banner banner, SearchVo searchVo, Pageable pageable);


    /**
     * 获取小程序首页轮播图 最多显示10条信息
     *
     * @return
     */
    @Cacheable(key = "'home'")
    List<Banner> getHomeBannerList();
}
